import { lazy } from "react";
import { Navigate } from "react-router-dom";
const HomePage = lazy(() => import("@/pages/Homepage"));
const T404 = lazy(() => import("@/pages/T404"));
const Message = lazy(() => import("@/pages/Message"));
const Essaydetail = lazy(() => import("@/pages/Essay"));
const Lin = lazy(() => import("@/pages/Lin"));
const Circle = lazy(() => import("@/pages/Circle"));
const Search = lazy(() => import("@/pages/search"));
const Write = lazy(() => import("@/pages/Write"));
const Userpage = lazy(() => import("@/pages/Userpage"));
const Edituser = lazy(() => import("@/pages/Edituser"));
const Notice = lazy(() => import("@/pages/Notice"));

export interface RouteObject {
  caseSensitive?: boolean;
  children?: RouteObject[];
  element?: React.ReactNode;
  index?: boolean;
  path?: string;
  auth?: boolean;
}

const router: RouteObject[] = [
  {
    path: "/",
    element: <Navigate to="/homepage" />,
  },
  {
    path: "/homepage",
    element: <HomePage />,
  },
  {
    path: "/404",
    element: <T404 />,
  },
  {
    path: "/message",
    element: <Message />,
  },
  {
    path: "/essaydetail/:id",
    element: <Essaydetail />,
  },
  {
    path: "/lin",
    element: <Lin />,
  },
  {
    path: "/circle",
    element: <Circle />,
  },
  {
    path: "/search",
    element: <Search />,
  },
  {
    path: "/write",
    element: <Write />,
  },
  {
    path: "/userpage/:id",
    element: <Userpage />,
  },
  {
    path: "/edituser",
    element: <Edituser />,
  },
  {
    path: "/notice",
    element: <Notice />,
  },
];

export default router;
